SASプログラム 10.1 
TITLE1  '層別シグモイド.SAS  << カドミウムガスの曝露  >> ' ;

DATA   d01  ;
   input  n @ ;
   A ="A1"; a1=1; a2=0; a3=0;
   do i=1,2,3 ;
     input  x  y  @  ;  output ;  end;

   A ="A2"; a1=0; a2=1; a3=0;
   do i=1,2 ;
     input  x  y  @  ;  output ;  end;
   
   A ="A3"; a1=0; a2=0; a3=1;
   input  x  y  @  ;    output ;
   
/*    ------------ A1 -----------   -------- A2 -------   -- A3 -- */
/*    x     y   x     y   x     y     x     y   x     y     x    y */   
datalines ;
 1   27  5.29  35  4.09  48  3.86    29  5.21  43  4.61    39  4.62 
 2   25  3.67  35  4.24  47  4.68    29  5.17  39  4.73    40  5.29 
 3   24  5.82  41  3.88  53  4.74    33  4.88  38  4.58    41  5.52 
 4   32  4.77  38  4.85  49  3.76    32  4.50  42  5.12    41  3.71 
 5   23  5.71  41  4.79  54  3.98    31  4.47  43  3.89    45  4.02 
 6   25  4.47  36  4.36  48  5.00    29  5.12  43  4.62    49  5.09 
 7   32  4.55  36  4.02  49  3.31    29  4.51  37  4.30    52  2.70 
 8   18  4.61  41  3.77  47  3.11    30  4.85  50  2.70    47  4.31 
 9   19  5.86  41  4.22  52  4.76    21  5.22  50  3.50    61  2.70 
10   26  5.20  37  4.94  58  3.95    28  4.62  45  5.06    65  3.03 
11   33  4.44  42  4.04  62  4.60    23  5.07  48  4.06    58  2.73 
12   27  5.52  39  4.51  65  4.83    35  3.64  51  4.51    59  3.67 
13   33  4.97  41  4.06  62  3.18    38  3.64  46  4.66     .    .  
14   25  4.99  43  4.02  59  3.03    38  5.09  58  2.88     .    .  
15   42  4.89  41  4.99   .    .      .    .    .    .      .    .  
;
proc print data=d01 ; run;

SASプログラム  10.2   3本のロジスティック曲線の同時あてはめ
proc nlin data=d01  maxiter=200  list outest=cov1 ;
    parms      θ0=5  θ1=4  θ2=3.5  θ3=3  β0=4  β1=-0.1 ;
          θ_k = (θ1*a1 + θ2*a2 + θ3*a3) ;
           g_x = exp(-(β0 + β1*x)) ;
    model    y = θ_k + (θ0 - θ_k) * (1 + g_x )**(-1) ;
run ;
proc print data=cov1 ; run;


